Repository navigation
[Server] Send every response through TransportInterface::send() - #562
Merged
chr-hertel merged 6 commits intoOct 10, 2026
Merged
Conversation
chr-hertel
requested review from
CodeWithKyrian,
Nyholm and
soyuka
as code owners
October 9, 2026 21:41
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Suspended exchanges mishandle save failures, and their final responses still bypass the documented universal send() path.
2 open findings
What changed in this PR
Routes normal server responses directly through transports instead of shared session queues.
Changes:
- Removes the inline-response marker interface.
- Updates HTTP response collection, protocol behavior, tests, and changelog.
- Suppresses session-save errors after responses are sent.
| File | Description |
|---|---|
src/Server/Protocol.php |
Sends responses directly and handles save failures. |
src/Server/Transport/TransportInterface.php |
Documents the revised response contract. |
src/Server/Transport/StreamableHttpTransport.php |
Collects direct responses for HTTP output. |
src/Server/Transport/InlineResponseTransportInterface.php |
Removes the obsolete marker interface. |
tests/Unit/Fixtures/RecordingTransport.php |
Adds a response-recording test transport. |
tests/Unit/Server/ProtocolTest.php |
Updates protocol tests for direct sending. |
tests/Unit/Server/Transport/StreamableHttpTransportTest.php |
Renames tests to match new terminology. |
CHANGELOG.md |
Documents behavior and compatibility changes. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
chr-hertel
force-pushed
the
inline-responses-follow-up
branch
from
October 9, 2026 22:38
40a3a0b to
c5f4866
Compare
Drops InlineResponseTransportInterface: the session's outgoing queue only carries server-initiated requests and notifications.
chr-hertel
force-pushed
the
inline-responses-follow-up
branch
from
October 10, 2026 00:07
d4ba3f3 to
b759d78
Compare
Comment on lines
+358
to
+362
| // The transport resumes the fiber from what the session holds: it must | ||
| // not get the fiber if the request the fiber awaits was not stored. | ||
| if (!$session->save()) { | ||
| throw new RuntimeException('Failed to save the session of a suspended request.'); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Follow-up to #535.
InlineResponseTransportInterface- every response goes throughTransportInterface::send(), the session queue only carries server-initiated requests & notificationssend(), see CHANGELOGcc @guillaume-sainthillier WDYT?